# $Id$
# Maintainer: Jan Alexander Steffens (heftig) <jan.steffens@gmail.com>
# Contributor: Ionut Biru <ibiru@archlinux.org>

pkgname=colord
pkgver=1.4.1
pkgrel=1
pkgdesc="System daemon for managing color devices"
arch=(i686 x86_64)
url="https://www.freedesktop.org/software/colord"
license=(GPL2)
depends=(lcms2 libgusb polkit sqlite systemd dconf dbus libgudev shared-mime-info)
makedepends=(gobject-introspection vala sane bash-completion argyllcms git docbook-utils
             docbook-sgml perl-sgmls meson gtk-doc)
optdepends=('sane: scanner support'
            'argyllcms: color profiling')
replaces=(shared-color-profiles)
install=colord.install
_commit=ef560710602ce590e72f8412cb200f68d6e3e153  # tags/1.4.1^0
source=("git+https://github.com/hughsie/colord#commit=$_commit")
sha1sums=('SKIP')
validpgpkeys=('163EB50119225DB3DF8F49EA17ACBA8DFA970E17')

pkgver() {
  cd $pkgname
  git describe --tags | sed 's/-/+/g'
}

prepare() {
  mkdir build
  cd $pkgname
}

build() {
  cd build
  meson setup --prefix=/usr --buildtype=release ../$pkgname \
    --localstatedir=/var --libexecdir=/usr/lib/$pkgname \
    -Denable-libcolordcompat=true \
    -Denable-sane=true \
    -Denable-vala=true \
    -Denable-print-profiles=true \
    -Dwith-daemon-user=colord
  ninja
}

check() {
  cd build
  meson test
}

package() {
  cd build
  DESTDIR="$pkgdir" ninja install

  # the build system has no colord user, so the chown fails
  chown -R 124:124 "$pkgdir/var/lib/colord"
}

# vim:set ts=2 sw=2 et:
